//这是一个C++中常用赋值符号的代码案例
//任务：掌握C++中常用赋值符号的意义，用法及用途
#include <iostream>
using namespace std;

int mian() {
    // =
    int a = 10;
    cout << "a的初始值为：" << a << endl; //应输出10
    a = 100; //用‘=’重新给a赋值为100
    cout << "a= " << a << endl; //应输出100
    //+=
    a = 10;
    a += 2;
    cout << "a= " << a << endl; //应输出12
    //-=
    a = 10;
    a -= 2;
    cout << "a= " << a << endl; //应输出8
    //*=
    a = 10;
    a *= 2;
    cout << "a= " << a << endl; //应输出20
    // /=
    a = 10;
    a /= 2;
    cout << "a= " << a << endl; //应输出5
    //%=
    a = 10;
    a %= 2;
    cout << "a= " << a << endl; //应输出0
    return 0;
}